<template>
  <div class="article_create">
      <div id="map_anhui" style="height:500px;"></div>
    <div style="text-align:left">
      <el-button  type="primary" @click="toBack">返回</el-button>
    </div>
  </div>
</template>
<script>
import {post} from '@/utils/request'
export default {
  data(){
    return {
      form:{}
    }
  },
  mounted(){
    // 3. 将地图渲染到容器中
    // 3.1 先获取地图数据 geo
    let mapData = Highcharts.maps['cn/anhui'];
    // 3.2 将geo数据绑定到页面中
    var map = Highcharts.mapChart('map_anhui', {
        title:{
          text:"安徽实时疫情监控"
        },
        series: [{
          mapData,
          data:[{
            name:"芜湖",
            value:"3"
          },{
            name:"蚌埠",
            value:"10"
          },{
            name:"淮南",
            value:"10"
          },{
            name:"马鞍山",
            value:"10"
          },{
            name:"铜陵",
            value:"10"
          },{
            name:"安庆",
            value:"10"
          },{
            name:"滁州",
            value:"10"
          }],
          joinBy:"name"
        }]
    });
    let article = this.$route.query;
    //alert(JSON.stringify(article));
    this.form = article;
  },
  methods:{
    submit(){
      let url = "http://121.199.29.84:8002/article/saveOrUpdate"
      post(url,this.form).then(resp => {
        // 提示
        this.$message({type:"success",message:resp.message})
        // 跳转
        this.toBack();
      })
    },
    toBack(){
      this.$router.go(-1);
    }
  }
}
</script>
<style scoped>

</style>